home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 2 / CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso / magazine / amiga_e / amigae.june.archive / 000102_crash!minyos.xx….OZ.AU!s924723_Wed, 16 Jun 93 17:50:19 PST.msg < prev    next >
Text File  |  1993-08-31  |  2KB  |  48 lines

  1. Received: by bkhouse.cts.com (V1.16/Amiga)
  2.     id AA00000; Wed, 16 Jun 93 17:50:19 PST
  3. Received: from peladon.rmit.OZ.AU by crash.cts.com with smtp
  4.     (Smail3.1.28.1 #15) id m0o67Uw-0000i7C; Wed, 16 Jun 93 17:06 PDT
  5. Received: from minyos.xx.rmit.OZ.AU by peladon.rmit.OZ.AU with SMTP id AA13648
  6.   (5.65c/IDA-1.4.4 for <amigae@bkhouse.cts.com>); Thu, 17 Jun 1993 10:05:34 +1000
  7. Received: by minyos.xx.rmit.oz.au
  8. Date: Thu, 17 Jun 93 10:05:04 EST
  9. Message-Id: <9306170005.3692@minyos.xx.rmit.oz.au>
  10. From: s924723@minyos.xx.rmit.OZ.AU (Son Huu Le)
  11. To: amigae@bkhouse.cts.com
  12. Subject: 
  13.  
  14.  
  15. >>Does anyone know a way/function to print out floats? Is there a procedure
  16. >>in either AmigaE itself, or ks2.04? >
  17.  
  18. >I had this problem too, in fact I couldn't figure out how to use floats
  19. >AT ALL...
  20.  
  21. Must have missed Wouter early.. the answer is:
  22.  
  23. /*
  24.     vary the "[4]" and "10000.0" for different precisions.
  25. */
  26.  
  27. PROC writefloat(float)
  28.     WriteF('\d.\z\d[4]\n',SpFix(float),
  29.             SpFix( SpMul( SpSub( SpFlt(SpFix(float)),float ),10000.0 ) ))
  30. ENDPROC
  31.  
  32. PROC main()
  33.     writefloat(0.0004)
  34.     writefloat(SpDiv(7.0, 22.0))
  35. ENDPROC
  36.  
  37. Originally, there was an extra SpAbs() around the SpSub(). But I can't
  38. think of a situation when (float - SpFix(float)) [or (float - Int(float)) in
  39. Basic] would be negative(?) so I removed it.
  40.  
  41. >Also does anybody know a good way to fake 2 dimensional arrays?  Since
  42. >E only uses 1 dimensional?  I fooled around trying to do this but always
  43. >ended up locking up the machine...
  44.  
  45. Sorry mate, haven't tried 2 dimensional stuff yet.
  46.  
  47. Bye!
  48. Son Le